package org.springsecuritylearn.repository.daoTest;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.PlatformTransactionManager;
import org.springsecuritylearn.repository.RepositoryApplicationTests;
import org.springsecuritylearn.repository.dao.BookDao;
import org.springsecuritylearn.repository.dao.EBookDao;
import org.springsecuritylearn.repository.domain.EBook;
import org.springsecuritylearn.repository.domain.PDFBook;


public class BookDaoTest2 extends RepositoryApplicationTests {

    @Autowired
    private BookDao bookDao;

    @Autowired
    private EBookDao eBookDao;

    @Autowired
    private PlatformTransactionManager platformTransactionManager;


    @Test
    public  void testExtends(){
        EBook eBook=new EBook();
        eBook.setName("ebook");
        eBook.setMobile("phone");

        eBookDao.saveAndFlush(eBook);

        PDFBook pdfBook=new PDFBook();
        pdfBook.setName("MM");
        pdfBook.setFormat("pdf");
        bookDao.saveAndFlush(pdfBook);

    }

}
